#pragma once

#define		uint	unsigned int

namespace davmath {

	// Mathematical constants
	static const float		PI				= 3.14159265358979323846f;	
	static const float		PI_OVER_360		= PI / 360.0f;

	// Min/Max
	#define max(a, b)    (((a) > (b)) ? (a) : (b))
	#define min(a, b)    (((a) < (b)) ? (a) : (b))

	// Clamp
	template <class T>
	static inline T clamp(T v, T min, T max) {
		if(v > max) { return max; }
		if(v < min) { return min; }
		return v;
	};

	// Radians to degrees
	static inline double RadToDeg(const double rad) {
		return rad * 180.0 / PI;
	};

	// Degrees to radians
	static inline double DegToRad(const double deg) {
		return (deg * PI / 180.0);
	};

};